<template>
    <el-container style="height: 100%">
        <el-aside class="detail-left" width="300px" style="height: 100%">
            <el-container style="height: 100%">
                <el-header class="headborder" height="39%">
                    <user-detail-head></user-detail-head>
                </el-header>
                <el-footer class="headborder" height="59%">
                    <user-detail-cls></user-detail-cls>
                </el-footer>
            </el-container>
        </el-aside>
        <el-main class="detail-main">
            <el-tabs v-model="planActiveName" @tab-click="">
                <el-tab-pane label="购课记录" name="first">
                    <user-detail-charge></user-detail-charge>
                </el-tab-pane>
                <el-tab-pane label="消课记录" name="second">
                    <user-detail-check></user-detail-check>
                </el-tab-pane>
            </el-tabs>
        </el-main>

        <el-dialog
            title="提示"
            :visible.sync="modifyUserVisible"
        >
            <add-student ref="stupanel" :childForm="userForm"></add-student>
        </el-dialog>


    </el-container>

</template>
<script>
    import {mapActions, mapState, mapGetters} from 'vuex'
    import headTop from '../components/headTop'
    import addStudent from '../page/addStudent'
    import userList from '../page/userList.vue'
    import updateStudent from '../page/updateStudent.vue'
    import {getUserList, getUserCount} from '@/api/getData'
    import userDetailPanel from '@/page/components/userDetailPanel'
    import userDetailCls from '@/page/components/userDetailCls'
    import userDetailCheck from '@/page/components/userDetailCheck'
    import userDetailCharge from '@/page/components/userDetailCharge'
    import userDetailHead from '@/page/components/userDetailHead'


    export default {
        data() {
            return {
                userForm:{},
                activityPanel: '',
                modifyUserVisible:false,
            }
        },
        components: {
            userDetailPanel,
            addStudent,
            userDetailCheck,
            userDetailCharge,
            userDetailHead,
            userDetailCls,
        },
        created() {

        },
        methods: {
            deleteuser:function(){
                this.$confirm('确认删除？')
                    .then(_ => {
                        confirmdelete();
                    })
                    .catch(_ => {});

            },


           async  confirmdelete(id){
                //确认删除
                var data = {"data": {"uid": row.uid}}
                 const res= await deleteUser(data)
                  this.$message({
                      type: 'success',
                      message: '删除成功'
                  });

            },
            back: function () {
                this.$router.back(-1);
            },
            refresh: function () {

            },
            handleoper: function (command) {
                if (command == "modify")
                    this.modifyuser();
                else
                    this.deleteuser();
            },
            modifyuser: function () {
                this.modifyUserVisible=true;

            },
            deleteuser: function () {
                alert("删除!");
            }

        }
    }
</script>

<style lang="less">
    @import '../style/mixin';

    .detail-left {

    }

    .detail-main {
    }

    .detail-title {
        font-size: 12px;
        font-weight: 500;
    }

    .user-detail {
        // #background-color: #F7F6F8;
    }

</style>
